import request from '@/utils/request'
const groupName = 'blog'

export function save(data) {
  return request({
    url: `/${groupName}/save`,
    method: 'post',
    data
  })
}

export function toUpdate(data) {
  return request({
    url: `/${groupName}/update`,
    method: 'put',
    data
  })
}

export function deleteById(data) {
  return request({
    url: `/${groupName}/delete/${data}`,
    method: 'delete'
  })
}

export function get(data) {
  return request({
    url: `/${groupName}/get/${data}`,
    method: 'get'
  })
}

export function getMeta(data) {
  return request({
    url: `/${groupName}/getMeta/${data}`,
    method: 'get'
  })
}

export function getUpdate(data) {
  return request({
    url: `/${groupName}/getUpdate/${data}`,
    method: 'get'
  })
}

export function getByPage(data) {
  return request({
    url: `/${groupName}/getByPage`,
    method: 'post',
    data
  })
}

export function getBlogByType(data) {
  return request({
    url: `/${groupName}/getBlogByType`,
    method: 'post',
    data
  })
}

export function getTimeLine(data) {
  return request({
    url: `/${groupName}/getTimeLine/${data}`,
    method: 'get'
  })
}
